# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-docx2python
_pkgname=${pkgname#python-}
pkgver=3.5.0
pkgrel=1
pkgdesc='Extract docx headers, footers, text, footnotes, endnotes, properties, and images to a Python object.'
arch=('any')
url='https://pypi.org/project/docx2python/'
license=('MIT')
depends=('python' 'python-lxml')
makedepends=('python-build' 'python-pip')
options=(!emptydirs)
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('82a0676d990c1f1295d5c78652dae664ed590a3503137612993dc0e2876fa9bbb1618f1ffb5d5b1bd156c80a8f28a6259ae25c0c54c6fc9f93a222680649b770')

build() {
  cd "$_pkgname-$pkgver"

  python -m build --wheel --outdir="$startdir/dist"
}

package() {
  cd "$_pkgname-$pkgver"

  pip install \
    --verbose \
    --disable-pip-version-check \
    --no-warn-script-location \
    --ignore-installed \
    --no-compile \
    --no-deps \
    --root="$pkgdir" \
    --prefix=/usr \
    --no-index \
    --find-links="file://$startdir/dist" \
    $_pkgname
}

